{% extends "project/base.html" %}
{% load static %}
{% block content %}
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
        {% if  request.user.role.role == 1 %}
            {% for object in object_list %}
            <div class="col-sm-4">
                <div class="contact-box">
                    <div class="col-sm-4">
                        <div class="text-center">
                            <img alt="image" class="img-square m-t-xs img-responsive" src="{% static 'img/python.jpg' %}">
                            <div class="m-t-xs font-bold"></div>
                        </div>
                    </div>
                    <div class="col-sm-8">
                        <h3><strong>{{ object.cname }}</strong></h3>
                        <p><i class="glyphicon glyphicon-book"></i> 班级： {{ object.classes }}</p>
                        <p><i class="glyphicon glyphicon-user"></i> 授课教师： {{ user.role.teacher.name }}</p>
                        <strong><p> <a class="J_menuItem" href="{% url 'project:homework_list_published' object.id %}">
                            <button class="btn btn-w-m btn-primary">进入课程</button>
                        </a></p></strong>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
            {% endfor %}
            <div class="col-sm-4">
                <div class="contact-box">
                    <div class="col-sm-4">
                        <div class="text-center">
                            <img alt="image" class="img-square m-t-xs img-responsive" src="{% static 'img/python.jpg' %}">
                            <div class="m-t-xs font-bold"></div>
                        </div>
                    </div>
                    <div class="col-sm-8">
                        <h3><strong>&nbsp;</strong></h3>
                        <p><a class="J_menuItem" href="{% url 'project:course_create' %}">
                            <button class="btn btn-w-m btn-primary"><i class="fa fa-plus"></i>添加课程</button>
                        </a></p>
                        <p>&nbsp;</p>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        {% endif %}
        {% if  user.role.role == 0 %}
            {% for object in object_list %}
            <div class="col-sm-4">
                <div class="contact-box">
                    <div class="col-sm-4">
                        <div class="text-center">
                            <img alt="image" class="img-square m-t-xs img-responsive" src="{% static 'img/python.jpg' %}">
                            <div class="m-t-xs font-bold"></div>
                        </div>
                    </div>
                    <div class="col-sm-8">
                        <h3><strong>{{ object.cname }}</strong></h3>
                        <p><i class="glyphicon glyphicon-book"></i> 班级： {{ object.classes }}</p>
                        <p><i class="glyphicon glyphicon-user"></i> 授课教师：{{ object.teacher.name }}</p>
                        <address>
                        </address>
                        <a class="J_menuItem" href="{% url 'project:homework_list' object.id %}"><button class="btn btn-w-m btn-primary" >进入课程</button></a>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
            {% endfor %}
        {% endif %}
        </div>
    </div>
</body>
{% endblock %}